//
//  BackgroundKnob.m
//  SKPAD
//
//  Created by admin@amonline.com.cn on 15/5/8.
//  Copyright (c) 2015年 amo. All rights reserved.
//

#import "KnobBackground.h"


@implementation KnobBackground

//代码创建初始化
-(id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _trackLayerBackground = [CALayer layer];
        _trackLayerBackground.backgroundColor = [UIColor clearColor].CGColor;
        _backgroundView = (id)[UIImage imageNamed:@"btnbg.png"].CGImage;
        _trackLayerBackground.contents =_backgroundView;
        _trackLayerBackground.bounds = frame;
    }
    return  self;
}

-(void)updateWithPosition:(CGRect)bounds
{
    //设置图层中心位置
    self.trackLayerBackground.position = CGPointMake(CGRectGetWidth(bounds)/2.0, CGRectGetHeight(bounds)/2.0);
}

@end